// AxiomToast 组件样式
.axiom-toast-container {
  position: fixed;
  z-index: var(--axiom-toast-container-z-index, 9999);
  pointer-events: none;
  
  // 位置变体
  &--top-right {
    top: var(--axiom-toast-container-offset, 20px);
    right: var(--axiom-toast-container-offset, 20px);
  }
  
  &--top-left {
    top: var(--axiom-toast-container-offset, 20px);
    left: var(--axiom-toast-container-offset, 20px);
  }
  
  &--bottom-right {
    bottom: var(--axiom-toast-container-offset, 20px);
    right: var(--axiom-toast-container-offset, 20px);
  }
  
  &--bottom-left {
    bottom: var(--axiom-toast-container-offset, 20px);
    left: var(--axiom-toast-container-offset, 20px);
  }
  
  &--top-center {
    top: var(--axiom-toast-container-offset, 20px);
    left: 50%;
    transform: translateX(-50%);
  }
  
  &--bottom-center {
    bottom: var(--axiom-toast-container-offset, 20px);
    left: 50%;
    transform: translateX(-50%);
  }
}

.axiom-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--axiom-toast-gap, 12px);
  min-width: var(--axiom-toast-min-width, 300px);
  max-width: var(--axiom-toast-max-width, 400px);
  padding: var(--axiom-toast-padding, 16px);
  margin-bottom: var(--axiom-toast-margin-bottom, 12px);
  background-color: var(--bg-color-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-base);
  box-shadow: var(--box-shadow-base);
  backdrop-filter: var(--axiom-toast-backdrop-filter, var(--backdrop-blur));
  -webkit-backdrop-filter: var(--axiom-toast-backdrop-filter, var(--backdrop-blur));
  pointer-events: auto;
  cursor: default;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  
  &:hover {
    box-shadow: var(--axiom-toast-hover-shadow, var(--box-shadow-hover, var(--box-shadow-base)));
    transform: var(--axiom-toast-hover-transform, translateY(-2px));
  }
  
  // 类型变体
  &--success {
    border-left: var(--axiom-toast-type-border-width, 4px) solid var(--success-color);
    
    .axiom-toast__icon {
      color: var(--success-color);
    }
  }
  
  &--warning {
    border-left: var(--axiom-toast-type-border-width, 4px) solid var(--warning-color);
    
    .axiom-toast__icon {
      color: var(--warning-color);
    }
  }
  
  &--error {
    border-left: var(--axiom-toast-type-border-width, 4px) solid var(--danger-color);
    
    .axiom-toast__icon {
      color: var(--danger-color);
    }
  }
  
  &--info {
    border-left: var(--axiom-toast-type-border-width, 4px) solid var(--primary-color);
    
    .axiom-toast__icon {
      color: var(--primary-color);
    }
  }
  
  // 可关闭状态
  &--closable {
    padding-right: var(--axiom-toast-closable-padding-right, 48px);
  }
  
  // 图标
  &__icon {
    flex-shrink: 0;
    width: var(--axiom-toast-icon-size, 20px);
    height: var(--axiom-toast-icon-size, 20px);
    margin-top: var(--axiom-toast-icon-margin-top, 2px);
    
    svg {
      width: 100%;
      height: 100%;
    }
  }
  
  // 内容
  &__content {
    flex: 1;
    min-width: 0;
  }
  
  // 标题
  &__title {
    font-size: var(--axiom-toast-title-font-size, 14px);
    font-weight: var(--axiom-toast-title-weight, 600);
    color: var(--text-color);
    font-family: var(--font-family-heading);
    line-height: 1.4;
    margin-bottom: var(--axiom-toast-title-margin-bottom, 4px);
  }
  
  // 消息
  &__message {
    font-size: var(--axiom-toast-message-font-size, 13px);
    color: var(--text-color-secondary);
    font-family: var(--font-family-base);
    line-height: var(--axiom-toast-message-line-height, 1.5);
    word-wrap: break-word;
  }
  
  // 关闭按钮
  &__close {
    position: absolute;
    top: var(--axiom-toast-close-btn-top, 12px);
    right: var(--axiom-toast-close-btn-right, 12px);
    width: var(--axiom-toast-close-btn-size, 20px);
    height: var(--axiom-toast-close-btn-size, 20px);
    border: none;
    background: none;
    color: var(--text-color-secondary);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    
    &:hover {
      background-color: var(--axiom-toast-close-btn-hover-bg, var(--border-color));
      color: var(--axiom-toast-close-btn-hover-color, var(--text-color));
    }
    
    svg {
      width: var(--axiom-toast-close-icon-size, 12px);
      height: var(--axiom-toast-close-icon-size, 12px);
    }
  }
  
  // 进度条
  &__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: var(--axiom-toast-progress-height, 3px);
    background: var(--axiom-toast-progress-bg, linear-gradient(
      90deg,
      var(--primary-color),
      var(--primary-color-light)
    ));
    border-radius: 0 0 var(--border-radius-base) var(--border-radius-base);
    animation: toast-progress linear forwards;
  }
}

// 进度条动画
@keyframes toast-progress {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

// 进入和离开动画
.axiom-toast-enter-active {
  transition: all 0.3s ease;
}

.axiom-toast-leave-active {
  transition: all 0.3s ease;
}

.axiom-toast-enter-from {
  opacity: 0;
  transform: translateX(100%);
}

.axiom-toast-leave-to {
  opacity: 0;
  transform: translateX(100%);
}

// 左侧位置的动画
.axiom-toast-container--top-left,
.axiom-toast-container--bottom-left {
  .axiom-toast-enter-from,
  .axiom-toast-leave-to {
    transform: translateX(-100%);
  }
}

// 中心位置的动画
.axiom-toast-container--top-center,
.axiom-toast-container--bottom-center {
  .axiom-toast-enter-from,
  .axiom-toast-leave-to {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  
  .axiom-toast-enter-to,
  .axiom-toast-leave-from {
    transform: translateX(-50%) translateY(0);
  }
}

// 移动端适配
@media (max-width: 768px) {
  .axiom-toast-container {
    &--top-right,
    &--top-left {
      top: var(--axiom-toast-mobile-offset, 10px);
      left: var(--axiom-toast-mobile-offset, 10px);
      right: var(--axiom-toast-mobile-offset, 10px);
      transform: none;
    }
    
    &--bottom-right,
    &--bottom-left {
      bottom: var(--axiom-toast-mobile-offset, 10px);
      left: var(--axiom-toast-mobile-offset, 10px);
      right: var(--axiom-toast-mobile-offset, 10px);
      transform: none;
    }
    
    &--top-center {
      top: var(--axiom-toast-mobile-offset, 10px);
      left: var(--axiom-toast-mobile-offset, 10px);
      right: var(--axiom-toast-mobile-offset, 10px);
      transform: none;
    }
    
    &--bottom-center {
      bottom: var(--axiom-toast-mobile-offset, 10px);
      left: var(--axiom-toast-mobile-offset, 10px);
      right: var(--axiom-toast-mobile-offset, 10px);
      transform: none;
    }
  }
  
  .axiom-toast {
    min-width: auto;
    max-width: none;
    width: 100%;
    
    &-enter-from,
    &-leave-to {
      transform: var(--axiom-toast-mobile-enter-transform, translateY(-20px)) !important;
    }
  }
}